package com.homevip.user.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * 角色
 * @author admin
 * 
 */
@Entity
@Table(name = "user_role")
public class User_role implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id
	@TableGenerator(name="myGenerator", table="myidlist", pkColumnName = "keyname", pkColumnValue="user_role", valueColumnName = "keyid", allocationSize=1 )
	@GeneratedValue(strategy = GenerationType.TABLE,generator="myGenerator") 
	@Column(name = "id")
	private int id;  //
	
	@Column(name = "cname", length = 50)
	private String cname;  //
	
	@Column(name = "status")
	private int status;  //是否生效 1否 2是
	
	@Column(name = "acls", length = 2000)
	private String acls;  //菜单权限
	
	@Column(name = "createdate", length = 20)
	private String createdate;  //创建时间
	
	@Column(name = "lastdate", length = 20)
	private String lastdate;  //更新时间
	
	@ManyToMany(mappedBy = "roles")
	private transient  List<User> users;
	
	public void setId(int id) {
		this.id = id;
	}
	public int getId() {
		return id;
	}
	
	public void setCname(String cname) {
		this.cname = cname;
	}
	public String getCname() {
		return cname;
	}
	
	public void setStatus(int status) {
		this.status = status;
	}
	public int getStatus() {
		return status;
	}
	
	public void setAcls(String acls) {	this.acls = acls;	}
	public String getAcls() {
		return acls;
	}
	
	public void setCreatedate(String createdate) {
		this.createdate = createdate;
	}
	public String getCreatedate() {
		return createdate;
	}
	
	public void setLastdate(String lastdate) {
		this.lastdate = lastdate;
	}
	public String getLastdate() {
		return lastdate;
	}
	
	public List<User> getUsers() {
		return users;
	}
	public void setUsers(List<User> users) {
		this.users = users;
	}
	
}
